package com.enjoy.tx;

import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.sql.SQLException;

public class TXTest {

    @Test
    public void test() {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("com.enjoy.tx");
        IB b = (IB) context.getBean("b");
        b.insert();
    }

    @Test
    public void test1() throws SQLException {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("com.enjoy.tx");
        IB b = (IB) context.getBean("b");
        b.insertUseMySQL();
    }

    @Test
    public void test2() throws SQLException {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("com.enjoy.tx");
        IB b = (IB) context.getBean("b");
        b.selectUseOracle();
    }

    @Test
    public void test3() throws SQLException {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("com.enjoy.tx");
        IB b = (IB) context.getBean("b");
        b.selectUseMySQL();
    }

}
